
public class FeedBackSimulator extends Simulation
{
	int quantum1;
	int quantum2;
	int quantum3;
	
	public FeedBackSimulator(int num_processes, int times_processes) {
		//Comparator for FIFO
		super(num_processes, times_processes, new FeedBackQueue<ProcessNode>(4));
		quantum1 = ((int)(8 * Math.random())) + 2;
		quantum2 = quantum1 * 2;
		quantum3 = quantum2 * 2;
	}
	
	public boolean interuptProcessSwitchConditions()
	{
		if((current_process.getTimesRan() == 1 && timeServicedOnCurrentProcess() >= quantum1) ||
				(current_process.getTimesRan() == 2 && timeServicedOnCurrentProcess() >= quantum2) ||
				(current_process.getTimesRan() == 3 && timeServicedOnCurrentProcess() >= quantum3))
		{
			return true;
		}
		return false;
	}
	
}
